package cn.xenosp.server.module.emailLog.service.impl;

import cn.xenosp.server.common.tools.ObjectConvert;
import cn.xenosp.server.module.emailLog.entity.SysMailLogVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.xenosp.server.module.emailLog.entity.SysMailLog;
import cn.xenosp.server.module.emailLog.service.SysMailLogService;
import cn.xenosp.server.module.emailLog.mapper.SysMailLogMapper;
import org.springframework.stereotype.Service;

import java.util.Arrays;

/**
* @author TongHui
* @description 针对表【sys_mail_log(邮件日志表)】的数据库操作Service实现
* @createDate 2025-01-14 14:23:03
*/
@Service
public class SysMailLogServiceImpl extends ServiceImpl<SysMailLogMapper, SysMailLog>
    implements SysMailLogService{

    @Override
    public IPage getPage(SysMailLogVO mailLogVO) {
        SysMailLog mailLog = new SysMailLog();
        Page page = new Page(mailLogVO.getPage(), mailLogVO.getLimit());
        ObjectConvert.copyVoToEntity(mailLogVO,mailLog);
        return baseMapper.page(page,mailLog);
    }

    @Override
    public void delete(String id) {
        removeById(id);
    }

    @Override
    public void delete(String[] ids) {
        removeBatchByIds(Arrays.asList(ids));
    }
}




